{template 'header'}
<link rel="stylesheet" href="{CSS_URL}city.css"/>
<!--当前位置-->
<div class="location layout960">
	当前位置: <a href="{SITE_URL}">首页</a>&nbsp;»&nbsp; <a href="{SITE_URL}city.php">切换城市</a>
</div>
<!--当前位置 end-->
<!--主体部分-->
<script type="text/javascript">
	function gocity(s) {
		Go('?action=go&' + s);
	}
</script>
<div class="layout960">
<table class="city-table" width="100%" cellpadding="6" cellspacing="1">
<tbody><tr>
	<th colspan="2">
        <div class="city-hd">
            <a class="{if $cityFilter == 'alphabet'}current {/if}bd-right" href="cityFilter=province" title="所有城市">所有城市</a>
            <a class="{if $cityFilter == 'province'}current bd-right{/if}" href="?cityFilter=province" title="所有省份">所有省份</a>
        </div>
		<span><a id="cityAuto" href="javascript:void(0);" title="智能选择">[智能]</a></span>
		&nbsp;&nbsp;<a id="cityAll" href="javascript:void(0);"{if $cityid == 0} class="f_b"{/if}>{$L[allcity]}</a>
	</th>
</tr>
{if $cityFilter == 'alphabet'}
{loop $lists $k $v}
<tr>
	<td class="title" width="58">{$k}</td>
	<td>
		<ul>
			{loop $v $j $s}
			<li class="cli"><a {if $s[linkurl]}href="{$s[linkurl]}"{else} data-url="areaid={$s[areaid]}" href="javascript:void(0);"{/if} {if $cityid == $s[areaid]} class="f_b"{/if} onclick="return false">{set_style($s[name], $s[style])}</a></li>
			{/loop}
		</ul>
	</td>
</tr>
{/loop}
{elseif $cityFilter== 'province'}
{loop $lists $v}
<tr>
	<td class="title" width="120">{$v[areaname]}</td>
	<td>
		<ul>
			{loop $v[subArea] $s}
			<li class="cli"><a data-url="areaid={$s[areaid]}" href="javascript:void(0);"{if $cityid == $s[areaid]} class="f_b"{/if} onclick="return false">{set_style($s[name], $s[style])}</a></li>
			{/loop}
		</ul>
	</td>
</tr>
{/loop}
{/if}
</tbody>
</table>
    <script>
        seajs.use('lm-util',function(util){
            $(".cli").each(function(){
                $(this).children('a').click(function(){
                    var u = $(this).attr('data-url');
                    if(u){util.goCity(u);}
                });
            });
            $("#cityAuto").click(function(){
                util.goCity("auto=1");
            });
            $("#cityAuto").click(function(){
                util.goCity("");
            });
        });
    </script>
</div>
<!--主体部分 end-->
{template 'footer'}